<!-- 新增模态框 -->
<div id="addByModel" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">

            <div class="modal-header">
                <h4 class="modal-title" id="myModalLabel">添加用户</h4>
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
                </button>
            </div>
            <div class="modal-body">
                <form action="javascript:void(0)" class="form-horizontal form-label-left">
                    <div class="form-group row">
                        <label class="control-label col-md-4">用户名</label>
                        <div class="col-md-8">
                            <input class="form-control" type="text" v-model="user.userName" placeholder="请输入用户名">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="control-label col-md-4">邮箱</label>
                        <div class="col-md-8">
                            <input class="form-control" type="text" v-model="user.email" placeholder="请输入邮箱">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="control-label col-md-4">密码</label>
                        <div class="col-md-8">
                            <input class="form-control" type="password" v-model="user.password" placeholder="请输入密码">
                        </div>
                    </div>
                    <div class="form-group row">
                        <label class="control-label col-md-4">角色</label>
                        <div class="col-md-8">
                            <span v-for="(role,index) in roles_db">
                                <input type="checkbox" :value="role.id" v-model="user.roles" />{{role.roleName}}
                            </span>
                        </div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" data-dismiss="modal" @click="addUser()">保存</button>
            </div>
        </div>
    </div>
</div>